Compiling Erlang via C
نویسنده
چکیده
This paper discusses the implementation of an Er-lang compiler which provides native compilation using C as an intermediate language. The intermediate output, while not elegant, is amenable to being ported away from the Erlang environment and into morètraditional' C based development environments. The compiler also provides a number of special features. These features include support for a concurrent monitoring system and simple static type analysis. Each Erlang module is compiled as a native shared object library to support dynamic code loading and unloading. In contrast to the standard Erlang implementation the runtime system is tightly integrated into the Unix environment. Er-lang processes are instantiated as actual Unix processes at runtime. This allows Unix system analysis and monitoring tools to be used upon individual Erlang processes. Overall this compiler ooers linear some computational performance improvements over standard Erlang systems while being highly portable and producing a re-usable intermediate code. The Erlang compiler, Gerl, described in this paper is a tool implemented as part of the support framework for a continuous software monitoring system. The compiler is intended to instrument system application code to automatically provide this monitoring system for the developer. The monitoring framework is described in 14]. There were a number of motivations for developing a new compiler. Primarily it was important that the design of the compiler included monitoring support as a central design feature of the system. It also allows the monitoring framework support to be built into the compiler in a modular way. This is important as the framework support is intended to be reused within other compilers. And nally it enabled the development of a fuller understanding of the mechanisms and performance issues related to implementing the monitoring framework. In developing the compiler a number of interesting implementation issues were explored: Translation of a functional language into an imperative form, particularly function poly-morphism, pattern matching, last call optimi-sation and exception handling. Implementing Erlang's highly concurrent process model. The issue of eecient garbage collection. The runtime support environment including integration with Unix and the runtime loading, linking and updating of compiled code. The performance of the compiler versus the existing virtual machine based implementations. This following sections discuss each of these issues in more detail. Problems areas and implementation choices are outlined and the chosen solutions are presented. 2 Translating Erlang to C Erlang code is compiled using C as an intermediate language. C ooers a variety …
منابع مشابه
Compiling Erlang to Scheme
The programming languages Erlang and Scheme have many common features yet the performance of the current implementations of Erlang appears to be below that of good implementations of Scheme This disparity has prompted us to investigate the translation of Erlang to Scheme Our intent is to reuse the mature compilation technology of cur rent Scheme compilers to quickly implement an e cient Erlang ...
متن کاملTemperature Mapping Software for Single-cell Cavities*
Cornell University routinely manufactures single-cell Niobium cavities on campus. These cavities will be used in the proposed Energy Recovery Linac (ERL). They are tested with a Temperature Mapping system (T-Map) in an effort to understand their heating behavior. In order to expedite this process, a Matlab program has been written that is capable of working with different acquisition hardware, ...
متن کاملA short note on the monotonicity of the Erlang C formula in the Halfin-Whitt regime
We prove a monotonicity condition satisfied by the Erlang C formula when computed in the Halfin-Whitt regime. This property was recently conjectured in Janssen et al. [2011]. Recently, there has been a renewed interest in the Erlang C formula (1) C(n, a) = an n!(1− ρ) ( n−1 ∑ k=0 ak k! + an n!(1− ρ) )−1 , that gives the probability of waiting for an arriving customers to an M/M/n system whose t...
متن کاملEvaluating the Erlang C and Erlang A Models for Call Center Modeling
We consider two queuing models commonly used to analyze call centers; the Erlang C and Erlang A models. The Erlang C is a very simple model that ignores caller abandonment and is the model most commonly used by practitioners and researchers. The Erlang A model allows for abandonment, but performance measures are more difficult to calculate. Several recent papers have advocated the use of the Er...
متن کاملWAMCC: Compiling Prolog to C
We present the wamcc system, a Prolog compiler that translates Prolog to C via the WAM. This approach has some interesting consequences: simplicity, efficiency, portability, extensibility and modularity. Indeed the system does not incorporate complex optimizations but is as efficient as Quintus Prolog 2.5 (based on an emulator written in assembly language) and only 30 % slower than Sicstus Prol...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 1998